package javase2.day08.demo2;

//递归计算1~n之间的和

import java.util.Scanner;

public class Demo02 {

    public static void main(String[] args) {
        int result = show(6);
        System.out.println(result);//21
    }

    public static int show(int i){
        if (i==1){
            return 1;
        }
        return i+show(i-1);


    }
}
